<template>
	<view>
		<view style="height: 320rpx;">
			<image src="../../static/bg@3x.png" style="width: 690rpx;height: 280rpx;margin-top: 40rpx;margin-left: 30rpx; position: absolute;"></image>
			<view style="position: relative;padding-top: 80rpx;color: #FFFFFF;font-size: 40rpx;line-height: 40rpx;margin-left: 60rpx;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;width: 600rpx;">{{name}}</view>
			<view style="font-size: 28rpx;color: #FFFFFF;line-height: 28rpx;margin-top: 20rpx;margin-left: 60rpx;position: relative;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;width: 440rpx;">{{address}}</view>
			<view style="font-size: 28rpx;color: #FFFFFF;line-height: 28rpx;margin-top: 20rpx;margin-left: 60rpx;position: relative;">{{corporation}} {{corporationMobile}}</view>
			<view style="width: 178rpx;height: 40rpx;margin-left: 60rpx;margin-top: 30rpx;background-color: #FFA940;font-size: 28rpx;color: #FFFFFF;text-align: center;position: relative;border-radius: 4rpx;">{{list.length}}条巡查记录</view>
		</view>
		<view style="margin-top: 28rpx;" v-for="(item,index) in list" :key="index"> 
			<view style="width: 690rpx;height: 98rpx;margin-left: 30rpx;border-bottom: 2rpx solid #E5E5E5;" @click="gotoRXQ(item.id)">
				<view style="color: #666666; font-size: 32rpx;line-height: 32rpx;padding-top: 32rpx;float: left;">{{item.checkTime}} 巡查</view>
				<view style="color: rgba(255, 77, 79, 1); font-size: 24rpx;margin-top: 32rpx;float: left;width: 108rpx;height: 36rpx;background-color: rgba(255, 77, 79, 0.12);margin-left: 20rpx;text-align: center;border-radius: 4rpx;">{{item.count}}处隐患</view>
				<!-- <view style="font-size: 36rpx;line-height: 36rpx;float: right;color: #999999;padding-top: 28rpx;">></view> -->
				<image src="../../static/iconjiantou@3x.png" style="width: 36rpx;height: 36rpx;padding-top: 30rpx;float: right;"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name:'',
				corporationMobile:'',
				corporation:'',
				address:'',
				ownerId:'',
				list:''
			}
		},
		methods: {
			gotoRXQ(id){
				uni.navigateTo({
					url:`./recordXQ?id=${id}`
				})
			},
			async getMes(){
				this.$myRequest({
					url:`/project_flood/v1/check/anwser/flood/list_by_type`,
					data:{"type":"1","ownerId":this.ownerId}
				}).then((res)=>{
					console.log(res);
					this.list=res.data.data
				})
			},
		},
		onLoad(options) {
			console.log(options);
			this.name=options.name
			this.address=options.address
			this.corporation=options.corporation
			this.corporationMobile=options.corporationMobile
			try {
			    const X = uni.getStorageSync('ownerId');
				this.ownerId=X;
			    if (X) {
			        // console.log(X);
			    }
			} catch (e) {
			    // error
			}
			this.getMes()
		}
	}
</script>

<style>

</style>
